package com.autonavi.yunda.yunji.core.vo.response;

import com.autonavi.yunda.yunji.core.enums.EngineType;
import com.autonavi.yunda.yunji.core.enums.InterfaceStatus;
import com.autonavi.yunda.yunji.core.model.dto.TaskConfigDTO;
import lombok.Data;

import java.sql.Timestamp;

@Data
public class SimpleTaskConfigVO {
    private Long id;
    private String name;
    private String projectId;
    private String description;
    private InterfaceStatus status;
    private EngineType engineType;
    private String createUser;
    private String updateUser;
    private Timestamp createTime;
    private Timestamp updateTime;
    private String projectName;

    public static SimpleTaskConfigVO from(TaskConfigDTO dto, String projectName) {
        SimpleTaskConfigVO vo = new SimpleTaskConfigVO();
        vo.setId(dto.getId());
        vo.setName(dto.getName());
        vo.setProjectId(dto.getProjectId());
        vo.setDescription(dto.getDescription());
        vo.setStatus(dto.getStatus());
        vo.setEngineType(dto.getEngineType());
        vo.setCreateUser(dto.getCreateUser());
        vo.setUpdateUser(dto.getUpdateUser());
        vo.setCreateTime(dto.getCreateTime());
        vo.setUpdateTime(dto.getUpdateTime());
        vo.setProjectName(projectName);
        return vo;
    }
}
